package su.samcom.calc.controller;

import su.samcom.calc.service.util.CalculatorUtil;
import su.samcom.calc.model.entity.Price;

import java.util.Comparator;

/**
 * Created with IntelliJ IDEA.
 * User: Владислав
 * Date: 24.11.13
 * Time: 18:33
 * To change this template use File | Settings | File Templates.
 */
public class PriceComparator implements Comparator<Price> {

    @Override
    public int compare(Price price1, Price price2) {
        if (CalculatorUtil.calculateLoadedPercent(price1) > CalculatorUtil.calculateLoadedPercent(price2)){
            return 1;
        }
        return -1;
    }
}
